<template>
  <!-- 顶层标题和进退按钮 -->
  <div class="topfloor">
    <div class="ico">
      <a @click="back" v-show="from">
        <img src="../assets/icon/my91/btn-back.png">
      </a>
    </div>
    <h1 class="title">{{ title }}</h1>
    <div class="ico">
      <a :href="to" v-show="to" v-html="html"></a>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'topnav',
    data () {
      return {

      }
    },
    // 声明props[返回URL, 跳转URL, 标题, 有导航内容]
    props: ['from', 'to', 'title', 'html'],
    methods: {
      back: function () {
        this.$router.back()
      }
    }
  }
</script>
